{{define "content"}}
<style type="text/css">
table {
display: table;
border-collapse: separate;
border-spacing: 2px;
border-color: gray;
}
tbody {
display: table-row-group;
vertical-align: middle;
border-color: inherit;
}
tr {
display: table-row;
vertical-align: inherit;
border-color: inherit;
}
  .form-table {
border-collapse: collapse;
margin-top: .5em;
width: 100%;
margin-bottom: -8px;
clear: both;
}
.form-table th, .form-wrap label {
text-shadow: #fff 0 1px 0;
vertical-align: top;
text-align: left;
padding: 10px;
width: 200px;
}
.form-table td {
margin-bottom: 9px;
padding: 8px 10px;
line-height: 20px;
font-size: 12px;
}

label {
vertical-align: middle;
cursor: pointer;
}
.wrap {
margin: 4px 15px 0 0;
}
.description, .form-wrap p {
color: #666;
}

#createuser .form-field input {
width: 25em;
}

.form-field input, .form-field textarea {
border-style: solid;
border-width: 1px;
width: 95%;
}
textarea, input[type="text"], input[type="password"], input[type="file"], input[type="button"], input[type="submit"], input[type="reset"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"], input[type="url"], select {
border-color: #dfdfdf;
background-color: #fff;
color: #333;
}
input, select {
line-height: 15px;
}
textarea, input, select {
margin: 1px;
padding: 3px;
}
</style>
<article class="module width_full">
  <header><h3><div id="icon-users" class="icon32"></div>添加新用户</h3></header>
  <h4 id="alert_info" class="alert_info">新建用户账户，并将用户加入此站点。</h4>
  <div class="module_content">
    <form action="/admin/adduser" method="post" name="createuser" id="createuser" class="add:users: validate">
      <input name="action" type="hidden" value="createuser">
      <input type="hidden" id="_wpnonce_create-user" name="_wpnonce_create-user" value="3a3d314280"><input type="hidden" name="_wp_http_referer" value="/wp-admin/user-new.php">
      <table class="form-table">
        <tbody><tr class="form-field form-required">
          <th scope="row"><label for="username">用户名 <span class="description">(必填)</span></label></th>
          <td><input name="username" type="text" id="username" value="" aria-required="true"></td>
        </tr>
        <tr class="form-field form-required">
          <th scope="row"><label for="email">电子邮件 <span class="description">(必填)</span></label></th>
          <td><input name="email" type="text" id="email" value=""></td>
        </tr>
        <tr class="form-field">
          <th scope="row"><label for="name">姓名 </label></th>
          <td><input name="name" type="text" id="name" value=""></td>
        </tr>
        <tr class="form-field form-required">
          <th scope="row"><label for="pass1">密码 <span class="description">(重复两次，必填)</span></label></th>
          <td><input name="passwd" type="password" id="pass1" autocomplete="off">
          <br>
          <input name="pass2" type="password" id="pass2" autocomplete="off">
          <br>
          <div id="pass-strength-result" style="display: block;">强度评估</div>
          <p class="description indicator-hint">提示：您的密码最好至少包含 7 个字符。为了保证密码强度，使用大小写字母，数字和符号，例如 ! " ? $ % ^ &amp; )。</p>
          </td>
        </tr>
        <tr>
          <th scope="row"><label for="send_password">发送密码？</label></th>
          <td><label for="send_password"><input type="checkbox" name="send_password" id="send_password"> 使用电子邮件将这个密码发给新用户。</label></td>
        </tr>
        </tbody>
      </table>

      <p class="submit"><input type="submit" name="createuser" id="createusersub" class="button-primary" value="添加新用户"></p>
    </form>
    <div class="clear"></div>
  </div>
</article><!-- end of post new article -->
<script type="text/javascript">
$(function(){
    $('#createuser').submit(function(){
        $.post($("#createuser").attr('action'), $("#createuser").serialize(), function(data){
            if (data.errno) {
                $('#alert_info').html(data.error)
            } else {
                $('#alert_info').html("添加成功！")
            }
        });
        return false;
    });
})
</script>
{{end}}